package org.itcast.travel.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import org.itcast.travel.pojo.Comment;
import org.itcast.travel.pojo.CommentLikeInfo;

@Mapper
public interface CommentMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Comment record);

    Comment selectByPrimaryKey(Integer id);

    List<Comment> selectAll();

    int updateByPrimaryKey(Comment record);



    void deleteChild(int commentId);


    List<Comment> selectList(Integer blogId);

    CommentLikeInfo selectByUserId(int commentId,int userId);


    @Update("update comment set count = count + 1 where id = #{commentId}")
    void updateCountByCommentId(int commentId);
}